package com.minimoment.model.service.impl;

import com.minimoment.base.BaseSupportImpl;
import com.minimoment.model.domain.Theater;
import com.minimoment.model.service.TheaterService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by etund on 2014/11/6.
 */
@Transactional
@Service
public class TheaterServiceImpl extends BaseSupportImpl<Theater> implements TheaterService{

    @Override
    public List<Theater> getByMovieId(Long id) {
        List<Theater> theaters = new ArrayList<Theater>();
        theaters = this.getSession().createQuery("from  Theater t join  t.movies as m where m.id =?").setParameter(0,id).list();
        return theaters;
    }
}
